<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title></title>
    <script type="text/javascript" src="http://cart.gulimall.com/static/cart/js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="http://cart.gulimall.com/static/cart/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="http://cart.gulimall.com/static/cart/js/swiper.min.js"></script>
    <script src="http://cart.gulimall.com/static/cart/js/swiper.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://cart.gulimall.com/static/cart/css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="http://cart.gulimall.com/static/cart/bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="http://cart.gulimall.com/static/cart/css/success.css"/>

</head>

<body>
<!--头部-->
<div class="alert-info">
    <div class="hd_wrap_top">
        <ul class="hd_wrap_left">
            <li class="hd_home"><i class="glyphicon glyphicon-home"></i>
                <a href="http://gulimall.com">谷粒商城首页</a>
            </li>
        </ul>

        <ul class="hd_wrap_right">
            <li class="forel">
                <a th:if="${session.loginUser==null}" href="http://localhost:88/api/admin/login.html"
                   style="color: #ff0000;">请登录</a>
                <a th:if="${session.loginUser!=null}" style="color: red;">[[${session?.loginUser?.userName}]]</a>
                <a th:if="${session.loginUser==null}">免费注册</a>
            </li>
            <li class="spacer"></li>

            <li>
                <a href="http://;">我的订单</a>
            </li>


        </ul>

    </div>
</div>

<div class="nav-tabs-justified">
    <div class="nav_wrap">

        <div class="nav_top">
            <div class="nav_top_one">
                <a href="http://gulimall.com"><img src="http://static/cart/img/logo1.jpg"
                                                   style="height: 60px;width:180px;"/></a>
            </div>
            <div class="nav_top_two"><input type="text"/>
                <button>搜索</button>
            </div>


        </div>

    </div>
</div>

<div class="main">
    <input type="hidden" id="hd" th:text="${orderSn}">
    <div class="success-wrap">
        <div class="w" id="result">
            <div class="m succeed-box">
                <div th:if="${orderSn!=null}" class="mc success-cont">
                    <h1>恭喜您秒杀成功,订单号[[${orderSn}]]</h1>
                    <h2>后台正在准备此订单,<span style="color: red" id="sp">10</span>s后自动跳转支付 <a style="color: red" th:href="${'http://localhost:88/api/alipay/pay?orderSn='+orderSn}">去支付</a></h2>

                </div>
                <div th:if="${orderSn==null}" class="mc success-cont">
                    <h1>秒杀失败</h1>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
<script th:inline="javascript">

    setInterval(a,1000);
    num = 10;
    var orderSn = [[${orderSn}]];
    function a() {
        $("#sp").html(num);
        num--;
        if (num<=0){
            location.href = "http://localhost:88/api/alipay/pay?orderSn="+orderSn;
        }
    }
</script>

</html>
